﻿/*********************************************
FileName:ShowPopWnd.h
ProjectName:MobileManage
FuncTion 个人信息管理类
Created: mr.l
Time: 15/7/4.
*********************************************/
#pragma once
#ifndef __MobileManage__ShowPopWnd__
#define __MobileManage__ShowPopWnd__

#include "cocos2d.h"
#include "CCValue.h"
#include "GNS_Common.h"
USING_NS_CC;


class GNS_PlayerMgr
{
private:
    GNS_PlayerMgr(); // removeChild
    ~GNS_PlayerMgr();

public:
	void setMyUseridx(long long idx);
	long long getMyUseridx();

	void setMyNickName(char * name);
	char * getMyName();

    //存储获取当前版本
	void setCurrentVersionClient(int Version);
	int getCurrentVersionClient();

    //存储获取更新地址
	std::string getUpdateURL();
	void setUpdateURL(std::string val);

    //存储获取服务器版本
	void setServerVersion(int version);
	int getServerVersion();

    //存储获取玩家级别
	void setUserLevel(int Level);
	int getUserLevel();

    //存储玩家充值比
	void setPlayTop(int Top);
	int getPlayTop();

    //获取存储备注名
    void setRemarkName(CMD_SC_GetRemarkNameResult*pGetRemark);
	std::map<int, string> * getRemarkName();

    //存储获取玩家信息
    CMD_SC_GetMobileUserinfoResult  pGetUserInfoResult;

    //存储获取个人充值、兑奖、转账查询
    void setUserExInfoRes(CMD_SC_GetUserExchangeInfoResult * pUserExInfoRes);
	map<int, vector<CMD_SC_GetUserExchangeInfoResult> > * getUserExInfoRes();

    //存储获取未读消息
    void setUserNotInfo(CMD_SC_GetUserNotExchangeInfoResult * pUserNotInfo);
	vector<CMD_SC_GetUserNotExchangeInfoResult> * getUserNotInfo();

    //存储获取二维码地址
    void setGameDownUrl(CMD_SC_GetGameDownLoadURLResult*pGameDown);
	vector<CMD_SC_GetGameDownLoadURLResult> *getGameDown();

    //存储获取管理记录
    void setUserManage(CMD_SC_GetAgentUserManageLogResult*pUserManage);
	vector<CMD_SC_GetAgentUserManageLogResult> * getUserManage();

    //存储获取充值比例
    void setAgRation(CMD_SC_GetAgentRechargeRatioResult * pGetAgRation);
	vector<CMD_SC_GetAgentRechargeRatioResult> *getAgRation();

    //存储获取运营商/代理商充/兑记录
    void setExList(CMD_SC_GetExchangeListResult * pExList);
	vector<CMD_SC_GetExchangeListResult> * getExListRes();
    
    //存储获取代理商占比
    void setAgProPer(CMD_SC_GetAgentProfitPercentResult *pAgProPer);
	vector<CMD_SC_GetAgentProfitPercentResult> * getAgProPer();

    //存储获取运营商占比
    void setOperatorAgProPer(CMD_SC_GetAgentProfitPercentResult *pOperatorAgProPer);
	vector<CMD_SC_GetAgentProfitPercentResult> * getOperatorAgProPer();
    
	void setExList1(CMD_SC_GetAgentProfitPercentResult * pExList1);
	vector<CMD_SC_GetAgentProfitPercentResult> * getExListRes1();

    //存储获取直属玩家冲兑
    void setLowlineInfo(CMD_SC_GetLowlineUserInfoResult * pLowlineInfo);
	vector<CMD_SC_GetLowlineUserInfoResult> * getLowlineInfo();

    //存储人机对战收税分成
    void setGameReveRes(CMD_SC_GetManToManGameRevenueResult * pGameReveRes);
	vector<CMD_SC_GetManToManGameRevenueResult> * getGameReveRes();

    //存储人机对战收税分成推广员
    void setGameProReveRes(CMD_SC_GetManToManGameRevenueResult * pGameProReveRes);
	vector<CMD_SC_GetManToManGameRevenueResult> * getGameProReveRes();

    //存储人机对战收税分成玩家
    void setGamePlayReveRes(CMD_SC_GetManToManGameRevenueResult * pGamePlayReveRes);
	vector<CMD_SC_GetManToManGameRevenueResult> * getGamePlayReveRes();

    //存储人机对战总玩数据
    void setPlayProFit(CMD_SC_GetManToMachPlayProfitResult * pPlayProFit);
	vector<CMD_SC_GetManToMachPlayProfitResult> * getPlayProFit();

    //存储人机对战总玩数据推广员
    void setPlayProProFit(CMD_SC_GetManToMachPlayProfitResult * pPlayProProFit);
	vector<CMD_SC_GetManToMachPlayProfitResult> * getPlayProProFit();

    //存储人机对战总玩数据玩家
    void setPlayProPlayFit(CMD_SC_GetManToMachPlayProfitResult * pPlayProPlayFit);
	vector<CMD_SC_GetManToMachPlayProfitResult> * getPlayProPlayFit();

    //存储人机对战总玩分成
    void setPlayProRation(CMD_SC_GetManToMachPlayProfitRatioResult * pPlayProRation);
	vector<CMD_SC_GetManToMachPlayProfitRatioResult> * getPlayProRation();

    //存储获取人机对战总玩分成
    void setPlayProProRation(CMD_SC_GetManToMachPlayProfitRatioResult * pPlayProProRation);
	vector<CMD_SC_GetManToMachPlayProfitRatioResult> * getPlayProProRation();

    //存储每日充值数据
    void setDialyToInfo(CMD_SC_GetDialyExchangeInfoResult * pDialyToInfo);
	vector<CMD_SC_GetDialyExchangeInfoResult> * getDialyToInfo();

    //存储每日兑奖数据
    void setDialyTiInfo(CMD_SC_GetDialyExchangeInfoResult * pDialyTiInfo);
	vector<CMD_SC_GetDialyExchangeInfoResult> * getDialyTiInfo();

    //存储每日转账数据
    void setDialyTrInfo(CMD_SC_GetDialyExchangeInfoResult * pDialyTrInfo);
	vector<CMD_SC_GetDialyExchangeInfoResult> * getDialyTrInfo();
    
    //获取存储游戏列表
    void setGameList(CMD_SC_HALLGAME_LIST * pGameList);
	vector<CMD_SC_HALLGAME_LIST> * getGameList();

    //获取存储个人信息
    void setUserInfoVec(CMD_SC_GetUserExchangeInfoResult * pUserInfo);
	vector<CMD_SC_GetUserExchangeInfoResult> * getUserInfo();
    
	void setUserExInfo(CMD_SC_GetUserFailExchangeInfoResult * pUserFailExInfo);
	vector<CMD_SC_GetUserFailExchangeInfoResult> * getUserFailExInfo();

    //退出清空数据
    void ClearAllVectorDate();
    
    //时间转换
    void transferEachTime(int &year,int &month,int &day,const char selDate[]);
    
    //保存每次切换的游戏ID
	void setGameId(const int gameId);
	int &getGameId();
    
    //添加游戏映射
    void addGameInfo(const int gameId, const char gameName[]);

	map<int, string>& getGameIdInfo();
	map<string, int>& getGameNameInfo();

	//获取下级和上级对应映射 key--下级 value--上级
	map<int, int>& getUpToLowCode();   
	void setUpToLowCode(const int lowlineCode,const int uplineCode);
    
	//获取下级和上级对应映射 key--下级 value--上级
	map<int, int>& getCodeAndRatio();
	void setCodeAndRatio(const int lowlineCode,const int rechargeRatio);

	// key-- 游戏名称 value--游戏类型
	map<string, int> &getNameType();

	// key-- 游戏类型 value --游戏名称
	map <int, vector<string> > &getGameTypeName();

	void pushNode(std::string strName,Node* oneNode);
	Node* getNode(std::string strName);
	void setVisible();
	void setVisible(std::string strName, bool bFlag);

public:
	static GNS_PlayerMgr * getInstance();
	Vector<Node *>_NodeChildVec;			//单个弹出窗口Vector
	//Vector<Node *>_NodeHallVec;				//HallScene Button Vector;
	std::map<std::string, Node*> _mapNodeHall;
	int ChooseMonNum;
	int ChooseDayNum;
	int Test;
	Scene * pCurrScene;
	int RevRepMag;
	int _playTop;
	int InfoResult_operType = 0;

private:
	static GNS_PlayerMgr * m_singleton;
    //玩家自己的数据
    long long m_MyUserIdx;
    long long m_MyLogID;
    char m_MyUserName[33];
    char m_MyNickName[33];
    int VersionClient;
    int VersionServer;
    std::string m_UpdateURL;
    int nAgentLevent;
    int     _selGameId;
    map<int,string> _gameIdName;
    map<string,int> _gameNameId;
	map<string, int> _gameNameType;
	map<int, vector<string> > _gameTypeName;
    map<int ,string> m_RemarkName;
    map<int,vector<CMD_SC_GetUserExchangeInfoResult> >m_userExInfoRes;
    vector<CMD_SC_HALLGAME_LIST>m_HallGameList;
    vector<CMD_SC_GetUserNotExchangeInfoResult>m_UserNotInfo;//获取未读消息
    vector<CMD_SC_GetGameDownLoadURLResult>m_GameDown;
    vector<CMD_SC_GetAgentUserManageLogResult>m_UserManage;
    vector<CMD_SC_GetAgentRechargeRatioResult>m_GetAgRation;//获取充值比例
    vector<CMD_SC_GetExchangeListResult> m_ExListRes;
    vector<CMD_SC_GetAgentProfitPercentResult> m_ExListRes1;
    vector<CMD_SC_GetAgentProfitPercentResult>m_AgProPer;
    vector<CMD_SC_GetAgentProfitPercentResult>m_OperatorAgent;
    vector<CMD_SC_GetLowlineUserInfoResult>m_LowlineInfo;
    vector<CMD_SC_GetManToManGameRevenueResult>m_GameReveRes;//人机对战收税分成
    vector<CMD_SC_GetManToManGameRevenueResult>m_GameProReveRes;//人机对战收税分成推官员
    vector<CMD_SC_GetManToManGameRevenueResult>m_GamePlayReveRes;//人机对战收税分成玩家
    vector<CMD_SC_GetManToMachPlayProfitResult>m_PlayProFit;//人机对战总玩数据
    vector<CMD_SC_GetManToMachPlayProfitResult>m_PlayProProFit;//人机对战总玩数据 推广员
    vector<CMD_SC_GetManToMachPlayProfitResult>m_PlayProPlayFit;//人机对战总玩数据 玩家
    vector<CMD_SC_GetManToMachPlayProfitRatioResult>m_PlayProRation;//人机对战总玩分成
    vector<CMD_SC_GetManToMachPlayProfitRatioResult>m_PlayProProRation;//人机对战总玩分成 推广员
    vector<CMD_SC_GetDialyExchangeInfoResult>m_DialyToInfo;//充值
    vector<CMD_SC_GetDialyExchangeInfoResult>m_DialyTiInfo;//兑奖
    vector<CMD_SC_GetDialyExchangeInfoResult>m_DialyTrInfo;//转账
    vector<CMD_SC_GetUserExchangeInfoResult>m_GetUserInfo;//
    vector<CMD_SC_GetUserFailExchangeInfoResult>m_GetUserFailExInfo;//获取退回消息
    vector<std::string>m_GameName;
	
	map<int, int> _mapUpToLowCode;		//下级和上级对应映射 key--上级编号 value--下级编号
	map<int, int> _mapCodeAndRatio;		//下级及充值比  key--下级编号 value--充值比例

	std::recursive_mutex _remarkName;
	std::recursive_mutex _userExInfoRes;
	std::recursive_mutex _HallGameList;
	std::recursive_mutex _UserNotInfo;//获取未读消息
	std::recursive_mutex _GameDown;
	std::recursive_mutex _UserManage;
	std::recursive_mutex _GetAgRation;//获取充值比例
	std::recursive_mutex _ExListRes;
	std::recursive_mutex _ExListRes1;
	std::recursive_mutex _AgProPer;
	std::recursive_mutex _OperatorAgent;
	std::recursive_mutex _LowlineInfo;
	std::recursive_mutex _GameReveRes;//人机对战收税分成
	std::recursive_mutex _GameProReveRes;//人机对战收税分成推官员
	std::recursive_mutex _GamePlayReveRes;//人机对战收税分成玩家
	std::recursive_mutex _PlayProFit;//人机对战总玩数据
	std::recursive_mutex _PlayProProFit;//人机对战总玩数据 推广员
	std::recursive_mutex _PlayProPlayFit;//人机对战总玩数据 玩家
	std::recursive_mutex _PlayProRation;//人机对战总玩分成
	std::recursive_mutex _PlayProProRation;//人机对战总玩分成 推广员
	std::recursive_mutex _DialyToInfo;//充值
	std::recursive_mutex _DialyTiInfo;//兑奖
	std::recursive_mutex _DialyTrInfo;//转账
	std::recursive_mutex _GetUserInfo;//
	std::recursive_mutex _GetUserFailExInfo;//获取退回消息
	std::recursive_mutex _GameName;
	std::recursive_mutex _clear;
};

#endif /* defined(__MobileManage__ShowPopWnd__) */